/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package myprogramui.comp.page2comp;

import brain.MyBrain;
import controller.MyController;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.control.TreeCell;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
import javafx.scene.layout.CornerRadii;
import javafx.scene.paint.Color;
import javafx.util.Callback;
import myfx.component.TextFieldTreeCellImpl;

/**
 *
 * @author Administrator
 */
public class RightTree extends TreeView<String>{

    private MyController controller;
    private MyBrain brain;
    public RightTree(final MyController controller,final MyBrain brain){
        this.controller=controller;
        this.brain=brain;
        this.setBackground(new Background(new BackgroundFill(Color.PINK, new CornerRadii(5), new Insets(-2))));
        TreeItem<String> rootItem = new TreeItem<String> (java.util.ResourceBundle.getBundle("myproj/globalizefile").getString("采场"));        
        rootItem.setExpanded(true);   
        this.setRoot(rootItem);
        
        this.setCellFactory(new Callback<TreeView<String>, TreeCell<String>>() {

            public TreeCell<String> call(TreeView<String> p) {
                return new TextFieldTreeCellImpl(controller,brain);
            }
        });
        
    }

}
